<template>
	<div class="qianmingguanli">
    <top></top>
    <div style="padding: 20px;">
      <el-table :data="list" style="width: 100%">
        <el-table-column align="center" prop="title" label="短信签名"></el-table-column>
        <el-table-column align="center" prop="status_name" label="审核状态"></el-table-column>
        <el-table-column align="center" prop="user_name" label="提交人"></el-table-column>
        <el-table-column align="center" prop="shop_name" label="店铺名称"></el-table-column>
        <el-table-column align="center" prop="mobile" label="联系方式"></el-table-column>
        <el-table-column align="center" prop="submit_time" label="注册时间"></el-table-column>
        <el-table-column align="center" prop="ok_count" label="操作">
          <template slot-scope="scope">
            <div class="flexcc">
              <div @click="shenhe(scope.row,0)" v-if="scope.row.status == 1" style="color: rgb(0, 90, 255); cursor: pointer; margin-right: 20px;">审核通过</div>
              <div @click="shenhe(scope.row,1)" v-if="scope.row.status == 1" style="color: rgb(0, 90, 255); cursor: pointer; margin-right: 20px;">审核拒绝</div>
              <div v-if="scope.row.status == -1">已拒绝</div>
              <div v-if="scope.row.status == 0">已通过</div>
            </div>
          </template>
        </el-table-column>
      </el-table>
    </div>
	</div>
</template>

<script>
  import top from '../top.vue'
	export default {
		name: 'qianmingguanli',
    components:{
      top
    },
		data() {
			return {
        list:[]
			}
		},
		created() {
      //列表
      this.getlist()

		},
		mounted() {

		},
		methods: {
      shenhe:function(item,val){
        if(val == 0){
          this.$confirm('确认通过审核吗?', '再次确认', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
              axios.post('/plat/sms-sign/examine/verify',{
                status:0,
                reason:"",
                id:item.id
              }).then((response)=>{
              	if (response.data.msg.code == 0) {
              		this.$message.success('操作成功');
              		this.getlist()
              	} else {
              		this.$message.error(response.data.msg.info);
              	}
              })
            })
        }
        if(val == 1){
          this.$prompt('请输入拒绝理由', '拒绝原因', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
          }).then(({ value }) => {
            axios.post('/plat/sms-sign/examine/verify',{
              status:-1,
              reason:value,
              id:item.id
            }).then((response)=>{
            	if (response.data.msg.code == 0) {
            		this.$message.success('操作成功');
                this.getlist()
            	} else {
            		this.$message.error(response.data.msg.info);
            	}
            })
          })
        }

      },
      getlist:function(){
        axios.get('/plat/sms-sign/list').then((response)=>{
        	if (response.data.msg.code == 0) {
        		this.list = response.data.data
        	} else {
        		this.$message.error(response.data.msg.info);
        	}
        })
      }
		}
	}
</script>


<style scoped >

</style>
